import Vue from 'vue'
import VueRouter from 'vue-router'
import UserLayout from '../layouts/UserLayout'
import BasicLayout from '../layouts/BasicLayout'

Vue.use(VueRouter)

  const routes = [{
    path:'/',
    redirect:'/user'
  },
  {
    path: '/user',
    component: UserLayout,
    redirect: '/user/login',
    meta: {
      router: 'User',
    },
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
      },
      {
        path: 'register',
        name: 'register',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Register')
      }
    ]
    },
    {
    path: '/project',
    name:'project',
    component: BasicLayout,
    redirect: '/project/sports',
    meta: {
      router: 'Project',
    },
    children: [
      {
        path: 'sports/:params',
        name: 'sports',
        component: () => import(/* webpackChunkName: "user" */ '@/components/card/card.vue')
      },{
          path: 'account',
          name: 'account',
          component: () => import(/* webpackChunkName: "user" */ '@/views/account/index.vue')
        },{
          path: 'video',
          name: 'video',
          component: () => import(/* webpackChunkName: "user" */ '@/layouts/VideoLayout.vue')
        }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
